import request from '@/router/axios';

// 可退款列表
export const canRefundList = (orderCode) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/canRefundList',
    method: 'get',
    params: {
      orderCode
    }
  })
}

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/pageList',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const getStatistics = (params) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/statistics',
    method: 'get',
    params: {
      ...params
    }
  })
}

/* 详情 */
export const getDetail = (orderCode) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/detail',
    method: 'get',
    params: {
      orderCode
    }
  })
}
/* 申请退款 */
export const applyRefund = (data) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/applyRefund',
    method: 'post',
    data
  })
}
/* 审核 */
export const shSubmit = (data) => {
  return request({
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/auditRewardService',
    method: 'post',
    data
  })
}
/* 导出 */
export const getExport = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/pledge/rbo_pledge_order/pageListExport',
    method: 'get',
    params: {
      ...params
    }
  })
}
